from typing import Optional, Dict, Any
from apps.core.unit_of_work import UnitOfWork
from ..models import DemoUser

class DemoUserService:
    """演示用户服务类，处理业务逻辑"""
    def __init__(self, uow: UnitOfWork= None):
        self.uow = uow or UnitOfWork()
    
    def get_user_by_id(self, user_id: int) -> Optional[DemoUser]:
        """根据ID获取用户"""
        with self.uow:
            return self.uow.demo_users.get_by_id(user_id)